#include <iostream>

using namespace std;

int main()
{
    long long a, b, h, k;
    cin >> a >> h >> b >> k;
    int cnt1 = h / b + (h % b != 0), cnt2 = k / a + (k % a != 0);
    if (cnt1 > cnt2)cout << cnt2 * (a + b) + a * 10 << endl;
    else if (cnt1 < cnt2)cout << cnt1 * (a + b) + b * 10 << endl;
    else cout << cnt1 * (a + b) << endl;
    return 0;
}